package p

import (
	"fmt"
	"unsafe"
)

type V struct {
	i int32
	J int64
}

func (v V) PrintI() {
	fmt.Printf("i=%d\n", v.i)
}

func (v V) PrintJ() {
	fmt.Printf("J=%d\n", v.J)
}
func (v *V) PrintSizeInfo() {
	fmt.Printf("sizeof v=%d\n", unsafe.Sizeof(*v))
	fmt.Printf("sizeof v.i=%d\n", unsafe.Sizeof(v.i))
	fmt.Printf("sizeof v.J=%d\n", unsafe.Sizeof(v.J))
}
func (v *V) PrintAlignInfo() {
	fmt.Printf("alignof v=%d\n", unsafe.Alignof(*v))
	fmt.Printf("alignof v.i=%d\n", unsafe.Alignof(v.i))
	fmt.Printf("alignof v.J=%d\n", unsafe.Alignof(v.J))
}

func init() {
	v := new(V)
	v.PrintSizeInfo()
	v.PrintAlignInfo()
}
